public class Test {
}
 class RectangleDemo {
    public static void main(String[] args) {
        // 创建矩形对象
        Rectangle rect = new Rectangle(5.0, 3.0);

        // 调用方法计算并显示结果
        System.out.println("矩形的长: " + rect.getLength());
        System.out.println("矩形的宽: " + rect.getWidth());
        System.out.println("矩形的面积: " + rect.calculateArea());
        System.out.println("矩形的周长: " + rect.calculatePerimeter());
    }
}

class Rectangle {
    private double length;
    private double width;

    // 构造方法
    public Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }

    // Getter方法
    public double getLength() {
        return length;
    }

    public double getWidth() {
        return width;
    }

    // 计算面积
    public double calculateArea() {
        return length * width;
    }

    // 计算周长
    public double calculatePerimeter() {
        return 2 * (length + width);
    }
}